<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <title>05-全局函数</title>

</head>

<body>

    <script>
        //数字解析
        let fontSize = "100.1px"
        // let i = parseInt(fontSize)
        let i = parseFloat(fontSize)
        console.log(i * 2); // 200, 200.2

        //url 编解码
        let url = "https://www.baidu.com/s?wd=%E9%BB%91%E9%A9%AC"
        url = decodeURI(url); //解码
        console.log(url);

        url = encodeURI(url); // 重新编码
        console.log(url); 
    </script>
</body>

</html>